#include<bits/stdc++.h>

using namespace std;

vector<int> v,num;
int a[100005],vis[100005],app[100005];

int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    memset(vis,0,sizeof(vis));
    memset(app,-1,sizeof(app));
    int n,m;
    scanf("%d",&n);
    m=n;
    for(int i=0;i<n;i++)
        scanf("%d",&a[i]);

    sort(a,a+n);
    v.push_back(a[0]);
    num.push_back(1);
    app[a[0]]=0;
    for(int i=1;i<n;i++)
    {
        if(a[i]!=a[i-1])
            app[a[i]]=i,v.push_back(a[i]),num.push_back(1);
        else
            num[num.size()-1]++;
    }
    for(int i=0,j=0;i<n;i++)
    {
        if(v[j+1]==a[i])
            j++;
        if(j>=v.size()-1)
            break;
        if(num[j+1]!=0)
        {
//            a[i]=-1;
            m--;
            num[j+1]--;
            vis[app[v[j+1]]++]=1;
        }
        else
            i=app[v[j+1]],j++;
    }
    cout<<m;
    return 0;
}
